package com.kili.cloud.common.security;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

/**
 * @description: 自定义spring security的配置项，便于调试的时候跳过安全验证
 * @author: tom.liu
 * @date: 2019/6/18 00:52
 */
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
    /**
     * 功能描述: 跳过安全验证
     * @param:
     * @return:
     * @author: tom.liu
     * @date: 2019/6/18 0:57
     */
    @Override
    protected void configure(HttpSecurity http)throws  Exception{
        http.authorizeRequests().anyRequest().permitAll().and().logout().permitAll();
        http.csrf().disable();
    }
}
